/**
  ************************************* 版权***********************************
  *
  *                 (C) 版权所有 2022,柴志强 所有权利             
  *                     
  *    
  * 文件名     :   flash.h   
  * 版  本     :    v1.0		
  * 作  者     :   柴志强			
  * 日  期     :   2022-08-29         
  * 功  能     :   Flash库函数 	
  *
  ******************************************************************************
 */

#ifndef __FLASH_H__
#define __FLASH_H__
#include "fm33lc0xx_fl.h"


/**
* FC046 存储空间是256K 是0x00000~0x40000 262144字节
* 到0x10000是0~64k 65536字节
* 200为一个扇区512个字节
* 128KB以后做安全数据区
**/

//#define flashAddress 			0x10000   //LC026 64K

#define flashAddress 			0x20000   //LC046 256K

extern FL_ErrorStatus FL_FLASH_Write_Dma(FLASH_Type *FLASHx, uint32_t address, uint32_t *data);
extern FL_ErrorStatus FL_FLASH_Read_Dma(FLASH_Type *FLASHx, uint32_t address, uint32_t *data, uint16_t length);

extern void flashSaveData(unsigned int address, unsigned int *data );
extern void flashReadData(unsigned int address, unsigned int *data,unsigned short length);


extern unsigned char _DEVICE_INFOR_BYTE[256];
extern unsigned int _DEVICE_INFOR_4K[64];


/***********基础数据定义*****************/
#define _IP1 _DEVICE_INFOR_BYTE[56]
#define _IP2 _DEVICE_INFOR_BYTE[57]
#define _IP3 _DEVICE_INFOR_BYTE[58]
#define _IP4 _DEVICE_INFOR_BYTE[59]
#define _PORT _DEVICE_INFOR_4K[15]
#endif
